﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="MacroServiceConfigurationTool.ascx.cs"
	Inherits="bct.MacroService.UserControls.MacroServiceConfigurationTool" %>

<%@ Register Assembly="controls" Namespace="umbraco.uicontrols" TagPrefix="cc1" %>
<%@ Import Namespace="bct.MacroService.Models" %>
<%@ Import Namespace="bct.MacroService.BusinessLogic" %>

<cc1:pane id="Pane1" runat="server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <table id="macroPane" cellspacing="0" cellpadding="4" width="98%" border="0">
                <asp:Repeater ID="Repeater1" runat="server" onitemcommand="Repeater1_ItemCommand">
                    <HeaderTemplate>
                        <tr>
                            <th><strong>Service Alias</strong></th>
                            <th><strong>Service Url</strong></th>
                            <th></th>
                        </tr>
                    </HeaderTemplate>
	                <ItemTemplate>    
                        <tr>
                            <td width="30%">
                                <asp:Literal ID="serviceAlias" runat="server" Text='<%# ((MacroServiceItem)Container.DataItem).alias %>'></asp:Literal>
                            </td>
                            <td width="50%">
                                <a href='<%= Config.Extension.servicePath %><%# ((MacroServiceItem)Container.DataItem).alias %>' target="_blank"><%= Config.Extension.servicePath %><%# ((MacroServiceItem)Container.DataItem).alias %></a>
                            </td>
                            <td style="text-align: right;"> 
                                <asp:Button ID="editMacroServie" runat="server" Text="Edit" CommandName="edit"/> <asp:Button ID="deleteMacroServie" runat="server" Text="Delete" CommandName="delete"/>
                            </td>
                        </tr>
    	            </ItemTemplate>
                    <FooterTemplate>
                          <tr style="border-top: 1px solid black;">
                            <td width="30%">
                                <strong>Service Alias</strong>
                            </td>
                            <td width="50%">
                                <asp:TextBox ID="serviceAlias" runat="server"></asp:TextBox>
                            </td>
                            <td style="text-align: right;">
                                <asp:Button ID="addMacroService" runat="server" Text="Add" CommandName="add"></asp:Button>
                            </td>
                        </tr>
                    </FooterTemplate>
                </asp:Repeater>    
            </table>
        </ContentTemplate>
    </asp:UpdatePanel>
</cc1:pane>